package com.hskn.hss.module.maintaincfg.service;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hskn.hss.core.annotation.DataScope;
import com.hskn.hss.core.domain.BaseEntity;
import com.hskn.hss.entity.AjaxResult;
import com.hskn.hss.exception.ExcelReaderDataException;
import com.hskn.hss.exception.HssException;
import com.hskn.hss.module.maintaincfg.entity.TlMaintainCfg;
import com.hskn.hss.module.maintaincfg.to.TlMaintainCfgListTO;
import com.hskn.hss.to.ForIdsTO;
import org.springframework.transaction.annotation.Transactional;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.List;

/**
 * <p>
 * 服务类
 * </p>
 *
 * @author hskn
 * @since 2021-05-06
 */
public interface ITlMaintainCfgService extends IService<TlMaintainCfg> {
    AjaxResult insert(JSONObject params) throws HssException;

    AjaxResult update(JSONObject params) throws HssException;

    @Transactional(rollbackFor = {RuntimeException.class, Error.class})
    AjaxResult deleteByid(ForIdsTO forIdsTO) throws HssException;

    TlMaintainCfg getDetailById(JSONObject params) throws HssException;

    JSONObject getList(BaseEntity baseEntity ,JSONObject params) throws HssException;

    void excelReader(List<TlMaintainCfg> maintainCfgList) throws ExcelReaderDataException;

    @DataScope(deptAlias = "deptidforcar", userAlias = "creatBy")
    List<TlMaintainCfg> getMaintainCfgList(TlMaintainCfgListTO inspectionCfgListTo, SimpleDateFormat format) throws ParseException;
}
